//
//  Common.swift
//  SHWeibo01
//
//  Created by 卫平玉 on 16/7/21.
//  Copyright © 2016年 卫平玉. All rights reserved.
//

import UIKit

let SHStatusCellMargin: CGFloat = 10
// 微博app切换根控制器的通知
let WBSwitchRootViewControllerNoti = "WBSwitchRootViewControllerNoti"
// 表情键盘删除按钮通知
let WBEmoticonDeleteButtonNoti = "WBEmoticonDeleteButtonNoti"

// 表情键盘按钮通知
let WBEmoticonButtonsNoti = "WBEmoticonButtonsNoti"

//与OC中的pch文件相似
let wbName = "18205699212"

let wbPasswd = "wpyzy1314520"

let APPKEY = "2864291424"

let APPSECRET = "2bb61f6cdb7001cd2fffcd1d5fb5308b"


let APPREDIRECT_URI = "http://www.baidu.com"
let ThemeColor = UIColor.orangeColor()

let SCREENW = UIScreen.mainScreen().bounds.size.width

let SCREENH = UIScreen.mainScreen().bounds.size.height

func RGB(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat = 1) -> UIColor{
    return UIColor(red: red / 255, green: green / 255, blue: blue / 255, alpha: alpha)
}

func RandomColor() -> UIColor{
    
    let r = random()%256
    
    let g = random()%256
    
     let b = random()%256
    
    return RGB(CGFloat(r), green: CGFloat(g)
, blue: CGFloat(b))
}

/// 打印
///
/// - parameter message:  打印内容
/// - parameter file:     类名
/// - parameter line:     行数
/// - parameter function: 方法名
func printLog<T>(message: T,file:String = __FILE__, line:Int = __LINE__, function: String = __FUNCTION__){
    // 上线后关闭打印 因为打印消耗性能
    #if DEBUG
        let f = (file as NSString).lastPathComponent
        let result = "\(f) [\(line)] \(function) : \(message)"
        print(result)
    #endif
}